<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表格操作</title>
    <link rel="stylesheet" href="2.css" type="text/css">
</head>
<body>
<h2>表格操作</h2>
<form id="dataForm">
    姓名: <input type="text" id="nameInput" class="input" required><br>
    年龄: <input type="number" id="ageInput" class="input" required><br>
    <button type="button" onclick="addRow()">添加</button>
</form>
<br>
<table id="myTable">
    <thead>
    <tr>
        <th>行号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <!-- 动态添加的行将在这里 -->
    </tbody>
</table>

<script src="2.js"></script>
</body>
</html>